﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace DataTemplateSelectorNS
{

   public class TillRollTemplateSelector : DataTemplateSelector
   {
      public DataTemplate BookingTemplate { get; set; }
      public DataTemplate CashTemplate { get; set; }
      public DataTemplate CCardTemplate { get; set; }
      public DataTemplate DefaultTemplate { get; set; }
      public override DataTemplate SelectTemplate(object item, DependencyObject container)
      {
         if (item is BookingLineItem) return BookingTemplate;
         if (item is CashPaymentLineItem) return CashTemplate;
         if (item is CCardPaymentLineItem) return CCardTemplate; return DefaultTemplate;
      }
   }
   public class LineItem { }
   public class BookingLineItem : LineItem { }
   public class CashPaymentLineItem : LineItem { }
   public class CCardPaymentLineItem : LineItem { }
}
